package com.ddx.common.enums;

/**
 * @author dudianbo
 * @ClassName: ${CLASSNAME}
 * @Description: 短信类型
 * @date 2018/4/26
 */
public enum TemplateType {
    FINDPASSWORD(1,"找回密码"),
    REGISTER(2,"注册"),
    WITHDRAW(3,"提现"),
    WITHDRAW_ADRESS_ADD(4,"提现地址添加"),
    REGISTER_SUCCESS(5,"注册成功"),
    AUDIT_FAILURE(6,"审核失败"),
    AUDIT_SUCCESS(8,"审核成功"),
    LOGIN(7,"登录"),
    LOGIN_PWD(9,"设置登录密码"),
    REMIND_USER(10,"提醒好友投资"),
    UPDATE_LOGIN_PASS(11,"修改登录密码"),
    UPDATE_FUND_PASS(12,"修改资金密码"),
    ALARM(99,"报警短信");
    private Integer code;
    private String msg;

    TemplateType(Integer code, String msg) {
        this.code=code;
        this.msg=msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public static TemplateType getTemplateType(Integer code) {
        for (TemplateType t : TemplateType.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }
}
